﻿using SnakeRemote.Services.BluetoothService;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SnakeRemote.Views.Converters
{
    public class BluetoothConnectionToStateStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var connection = (BluetoothConnection)value;
            if (connection is null)
                return $"没有正连接着的蛇";
            else if(connection.IsConnected)
                return $"正连接着 {connection.Device}";
            else
                return $"已经断开 {connection.Device}";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
